package com.hc.util;

public class UseFloorHigthUtil {
 public static void useFloorHigth(Integer[] message){
	 
	 if(CommonData.isUseBaseStation_FH_1){
		 
		 int num = (int) Math.sqrt(message[2]*message[2] - CommonData.baseStation_FH_1*CommonData.baseStation_FH_1);
		 
		 if(num>50){
			 message[2] =  num;
		 }else{
			 message[2] =  50;
		 }
	
		 
	 }
	 if(CommonData.isUseBaseStation_FH_2){
		 int num =  (int) Math.sqrt(message[3]*message[3] - CommonData.baseStation_FH_2*CommonData.baseStation_FH_2);
		 if(num>50){
			 message[3] =  num;
		 }else{
			 message[3] =  50;
		 }
	
	 }
	 if(CommonData.isUseBaseStation_FH_3){
		 int num =  (int) Math.sqrt(message[4]*message[4] - CommonData.baseStation_FH_3*CommonData.baseStation_FH_3);
		 if(num>50){
			 message[4] =  num;
		 }else{
			 message[4] =  50;
		 }
	
	 }
	 if(CommonData.isUseBaseStation_FH_4){
		 int num =  (int) Math.sqrt(message[5]*message[5] - CommonData.baseStation_FH_4*CommonData.baseStation_FH_4);
		 if(num>50){
			 message[5] =  num;
		 }else{
			 message[5] =  50;
		 }
	
	 }
	 
 }
 
	 public static void main(String[] args) {
		Integer[] testArray = {1,1,5,5,5,5};
		UseFloorHigthUtil.useFloorHigth(testArray);
		
		
		for(int i =0;i <testArray.length;i++ ){
			
			System.out.println(testArray[i]);
		}
		
	}
}
